import 'package:acaleph/mvp/presenter/test_list_presenter.dart';
import 'package:acaleph/mvp/repository/test_list_repository.dart';
import 'package:acaleph/mvp/repository/test_list_repository_impl.dart';

class TestListPresenterImpl implements TestListPresenter {
  TestListView _view;

  TestListRepository _repository;
  TestListPresenterImpl(this._view) {
    _view.setPresenter(this);
  }

  @override
  loadList(String id) {
    assert(_view != null);
    _repository.loadList(id).then((data) {
      _view.onLoadListSuc(data);
    }).catchError((error) {
      _view.onLoadListFail();
    });
  }

  @override
  init() {
    _repository = new TestListRepositoryImpl();
  }
}
